package frontend.components.base;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.html.form.PasswordTextField;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;

public class PasswordFieldComponent<ModelType> extends Panel {

    public PasswordFieldComponent(String propertyId, String labelResourceKey, ModelType model) {
        super(propertyId);
        Label label = new Label("label", new ResourceModel(labelResourceKey));
        PasswordTextField passwordField = new PasswordTextField("passwordField",
                new PropertyModel<String>(model, propertyId));
        passwordField.setRequired(false);
        passwordField.setResetPassword(false);
        add(label, passwordField);
        setOutputMarkupId(true);
        setOutputMarkupPlaceholderTag(true);
    }
}
